package com.student.Activitys.activity;

import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.google.gson.Gson;
import com.student.Activitys.R;
import com.student.Activitys.activity.base.BaseActivity;
import com.student.Activitys.bean.UserBean;
import com.student.Activitys.utils.Constant;

import butterknife.Bind;

/**
 * 项目名称：智慧校园学生端
 * 类描述：个人信息页面
 * 创建人：张飞祥
 * 创建时间：2017/10/13 8:45
 * 修改人：张飞祥
 * 修改时间：2017/10/13 8:45
 * 修改备注：
 */
public class MyInfoActivity extends BaseActivity {


    @Bind(R.id.iv_return)
    ImageView ivReturn;
    @Bind(R.id.tv_title)
    TextView tvTitle;
    @Bind(R.id.iv_save)
    ImageView ivSave;

    @Bind(R.id.tv_group_my_name)
    TextView tvGroupMyName;
    @Bind(R.id.tv_group_my_sex)
    TextView tvGroupMySex;
    @Bind(R.id.tv_group_my_nation)
    TextView tvGroupMyNation;
    @Bind(R.id.tv_group_my_student_id)
    TextView tvGroupMyStudentId;
    @Bind(R.id.tv_group_my_class)
    TextView tvGroupMyClass;
    @Bind(R.id.tv_group_my_position)
    TextView tvGroupMyPosition;
    @Bind(R.id.tv_group_my_politics)
    TextView tvGroupMyPolitics;
    @Bind(R.id.ev_group_my_id)
    EditText evGroupMyId;
    @Bind(R.id.ev_group_my_phone_number)
    EditText evGroupMyPhoneNumber;
    @Bind(R.id.ev_group_my_email)
    EditText evGroupMyEmail;
    @Bind(R.id.ev_group_my_qq)
    EditText evGroupMyQq;
    @Bind(R.id.ev_group_my_weixin)
    EditText evGroupMyWeixin;
    @Bind(R.id.ev_group_my_address)
    EditText evGroupMyAddress;

    @Bind(R.id.ev_group_my_father_name)
    EditText evGroupMyFatherName;
    @Bind(R.id.ev_group_my_father_phone_number)
    EditText evGroupMyFatherPhoneNumber;
    @Bind(R.id.ev_group_my_father_company)
    EditText evGroupMyFatherCompany;
    @Bind(R.id.ev_group_my_father_post)
    EditText evGroupMyFatherPost;
    @Bind(R.id.ev_group_my_mother_name)
    EditText evGroupMyMotherName;
    @Bind(R.id.ev_group_my_mother_phone_number)
    EditText evGroupMyMotherPhoneNumber;
    @Bind(R.id.ev_group_my_mother_company)
    EditText evGroupMyMotherCompany;
    @Bind(R.id.ev_group_my_mother_post)
    EditText evGroupMyMotherPost;

    @Override
    protected void initUI() {
        setContentView(R.layout.act_my_info);
        //标题
        tvTitle.setText("个人信息");
        //显示退出按钮
        ivReturn.setVisibility(View.VISIBLE);
        //显示保存按钮
        ivSave.setVisibility(View.VISIBLE);
    }

    @Override
    protected void initData() {
        /**
         * 创建 Gson 解析储存的用户数据 反填 界面数据
         */
        Gson gson = new Gson();
        UserBean myUser =  gson.fromJson(mACache.getAsJSONObject(Constant.USER)+"", UserBean.class);
        /**
         *  反填用户数据 到 我的个人信息
         */
        //姓名
        tvGroupMyName.setText(myUser.getStuName());
        //性别
        tvGroupMySex.setText(myUser.getXB());
        //民族
        tvGroupMyNation.setText(myUser.getMZ());
        //学号
        tvGroupMyStudentId.setText(myUser.getXH());
        //班级
        tvGroupMyClass.setText(myUser.getXZBJ());
        //在读职位
        tvGroupMyPosition.setText(myUser.getZDZW());
        //政治面貌
        tvGroupMyPolitics.setText(myUser.getZZMM());
        //身份证号
//        evGroupMyId.setText(myUser.getStuName());
        //手机号
//        evGroupMyPhoneNumber.setText(myUser.getStuName());
        //邮箱地址
//        evGroupMyEmail.setText(myUser.getStuName());
        //QQ
//        evGroupMyQq.setText(myUser.getStuName());
        //微信
//        evGroupMyWeixin.setText(myUser.getStuName());
        //家庭住址
//        evGroupMyAddress.setText(myUser.getStuName());
    }

    @Override
    protected void getNotData() {

    }
}
